home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Merciful 5
/
Merciful - Disc 5.iso
/
software
/
r
/
real_3d
/
real3dv3.3b.dms
/
real3dv3.3b.adf
/
RPL.LZH
/
RPL
/
procmat.rpl
< prev
next >
Wrap
Text File
|
1995-05-04
|
1KB
|
67 lines
( Procedural Material Examples
?& PROCMAT.RPL NOT ?IF
17 CONSTANT PROCMAT.RPL
3.1416 FCONSTANT PI
( Some RPL Bump Handlers. To apply them in a material, use the Procedures
( menu of the material window to select this file 'r3d3:rpl/procmat.rpl'.
( Then set Bump handler to RPL and type the name of the desired handler
( name to the Expression field
: BumpWave
x F@ 10 F* PI t F@ F* F+ SIN a F@ 2 F+ F* bx F!
y F@ 10 F* PI t F@ F* F+ SIN b F@ 2 F+ F* by F!
;
: BumpCircular
r F@ 10 F* SIN 10 F* bx F!
r F@ 10 F* COS 10 F* by F!
;
: BumpAnimated
r F@ 10 F* 10 T F@ F* F+ SIN 10 F* bx F!
r F@ 10 F* 10 T F@ F* F+ COS 10 F* by F!
;
: BumpWaterDrop
z F@ 30 F* t F@ 30 F* F- COS 5 F* 5 F+
1 z F@ 30 F* 1 F+ F/ F*
2 z F@ 30 F* t F@ 30 F* F- DUP F* 1 F+ F/ F*
DUP bx F! by F!
;
: BumpFadedWave
z F@ 30 F* t F@ 30 F* F- COS 5 F* 5 F+
1 z F@ 30 F* 1 F+ F/ F*
DUP bx F! by F!
;
( Some color RPL handlers: set Color handler to RPL and type the name
( of the desired word to the Expression field
: ColorWave
x F@ y F@ z F@ F+ F+ DUP DUP
50 F* SIN 127 F* 128 + R !
30 F* SIN 127 F* 128 + G !
10 F* SIN 127 F* 128 + B !
;
( Use cylinder mapping for this
: ColorWood
z F@ 10 F* 1 FMOD 0.5 F> IF
255 R !
200 G !
120 B !
ELSE
200 R !
150 G !
0 B !
ENDIF
;
?ENDIF